﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace VoiceTestPlatform
{
    public class StopBitsToStrConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            StopBits s = (StopBits)value;
            switch (s)
            {
                case StopBits.None:
                    return "0";
                case StopBits.One:
                    return "1";
                case StopBits.OnePointFive:
                    return "1.5";
                case StopBits.Two:
                    return "2";
                default:
                    return "0";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
